package com.bawei.monthdemo2207a.month01.soft

import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.view.View

/**
 * 作者：赵亮
 * 时间：2024/12/27 11:55
 * 功能：
 */
class MyView : View {

    constructor(context: Context?) : super(context)
    val paint = Paint().apply {
        style = Paint.Style.FILL
        color = Color.RED
        strokeWidth = 5f
    }

    override fun onDraw(canvas: Canvas) {
        super.onDraw(canvas)
        canvas.drawCircle(100f, 100f, 10f, paint)
        canvas.drawLine(0f, 0f, 100f, 200f, paint)
        canvas.drawRect(0f, 0f, 100f, 300f, paint)
    }
}